﻿namespace Simple.Services.System.User.Models
{
    public class NoticeModel : ModelBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string? Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime? SendTime { get; set; }

        /// <summary>
        /// 发送部门
        /// </summary>
        public Guid? DepartmentId { get; set; }

        /// <summary>
        /// 发送班级
        /// </summary>
        public Guid? ClassId { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        public bool IsRead { get; set; }

        /// <summary>
        /// URL(冗余，暂时不用)
        /// </summary>
        public string? Url { get; set; }

        /// <summary>
        /// 接收人Id
        /// </summary>
        public Guid? Receiver { get; set; }
        /// <summary>
        /// 发送人名称
        /// </summary>
        public string? SendUserName { get; set; }

        /// <summary>
        /// 是否属于原始发送数据
        /// </summary>
        public bool IsOriginal { get; set; }

        /// <summary>
        /// 是否已发送
        /// </summary>
        public bool IsSend { get; set; }

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<SysNotice, NoticeModel>();

            profile.CreateMap<NoticeModel, SysNotice>()
                .ForMember(d => d.Id, options => options.Ignore());
        }
    }
}
